package com.wang.spring.event;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;


/**
 * spring  内置了四种事件
 * 1、ApplicationEvent
 * 2、ApplicationContextEvent
 * 3、ContextRefreshedEvent & ContextClosedEvent
 * 4、ContextStartedEvent & ContextStoppedEvent
 */
public class ContextRefreshedApplicationListenerTest {
    public static void main(String[] args) {
        System.out.println("开始准备初始化IOC容器");
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext("com.wang.spring.event");
        System.out.println("IOC 容器初始化完成====");
        ctx.close();
        System.out.println("IOC 容器关闭完成===");
    }
}
